# http://doc.qt.nokia.com/4.7/qmake-variable-reference.html
# http://doc.qt.nokia.com/4.7/qmake-function-reference.html
# http://developer.qt.nokia.com/doc/qt-4.8/designer-creating-custom-widgets.html
#-------------------------------------------------------------
# Configuration
#-------------------------------------------------------------
# Enable project to be built in both modes, but Qt Designer only
# makes use of the release build
CONFIG      += designer plugin debug_and_release


#-------------------------------------------------------------
# Name of the target (modified depending on the building mode)
# qtLibraryTarget might be empty
#-------------------------------------------------------------
# Modify target name according when building in debug mode
TARGET_DEBUG_SUFFIX = d
CONFIG(debug, debug|release) {
    TARGET_DEBUG_SUFFIX = d
} else {
    TARGET_DEBUG_SUFFIX =
}


#TARGET     = $$qtLibraryTarget($$TARGET)
TARGET      = qswitchplugin$$TARGET_DEBUG_SUFFIX


#-------------------------------------------------------------
# Version is used as a suffix to the target's name
# but on win32 only the major version is appended to the
# target's name
#-------------------------------------------------------------
#VERSION    = 1 # Not used


#-------------------------------------------------------------
# The template here is just a lib
#-------------------------------------------------------------
TEMPLATE    = lib


#-------------------------------------------------------------
# Resources
#-------------------------------------------------------------
RESOURCES = qswitch.qrc


#-------------------------------------------------------------
# Specifies where to put the target file(s) - platform dependant
# todo : We could also make this architecture
# (x86, ppc, x86_64, ...) dependant. The user will then have to
# copy the lib to the designer plugin path himself
#-------------------------------------------------------------
macx {
    PLATFORM = mac
}
unix: !macx {
    PLATFORM = linux
}
win32 {
    PLATFORM = windows
}
DESTDIR     = build/$$PLATFORM
OBJECTS_DIR = build/$$PLATFORM/tmp
MOC_DIR     = build/$$PLATFORM/tmp
UI_DIR      = build/$$PLATFORM/tmp
RCC_DIR     = build/$$PLATFORM/tmp


#-------------------------------------------------------------
# Sources
#-------------------------------------------------------------
include(qswitchplugin.pri)
# todo : use precompiled header when possible
HEADERS     += qswitchplugin.h
SOURCES     += qswitchplugin.cpp



#QTDIR_build:DESTDIR     = $$QT_BUILD_TREE/plugins/designer
# Ensure that the plugin is installed together with other Qt Designer widget plugins
#target.path = $$[QT_INSTALL_PLUGINS]/designer
#sources.files = $$SOURCES $$HEADERS *.pro
#sources.path = $$[QT_INSTALL_EXAMPLES]/designer/qswitchplugin
#INSTALLS += target sources
